<template>
  <common-page
    ref="commonPage"
    page-type="hdPage"
    :bg-path="bgPath"
    :web-path="webPath"
    :columns="columns"
    :search-items="searchItems"
    :form-items="formItems"
    :d-table-config="dTableConfig"
  />
</template>
<script>
export default {
  data() {
    return {
      // ===== ===== ===== ===== 全局属性 ===== ===== ===== =====
      // 后台接口路径
      bgPath: 'base/dictionary/healthdic/dietdirectory',
      // Web路径
      webPath: 'base/dictionary/health_dic/diet_directory',
      // ===== ===== ===== ===== 页面配置 ===== ===== ===== =====
      // 搜索内容
      searchItems: [
        {
          rowIndex: 1,
          items: [
            {
              code: "code",
              name: "编码",
              span: 6,
              type: "text",
              config: {
                edit: false
              }
            },
            {
              code: "name",
              name: "名称",
              span: 6,
              type: "text",
              config: {
                edit: false
              }
            }
          ]
        }
      ],
      // 列表内容
      columns: [
        {
          code: "code",
          name: "编码",
          span: 6,
          type: "text",
          config: {
            edit: false
          }
        },
        {
          code: "name",
          name: "名称",
          span: 6,
          type: "text",
          config: {
            edit: false
          }
        }
      ],
      // 增加/修改/详情 表单
      formItems: [
        {
          rowIndex: 1,
          items: [
            {
              code: "code",
              name: "编码",
              span: 6,
              type: "text",
              config: {
                edit: false,
                rules: [
                  { required: true, message: '请输入编码', trigger: 'blur' }
                ]
              }
            },
            {
              code: "name",
              name: "名称",
              span: 6,
              type: "text",
              config: {
                edit: false,
                rules: [
                  { required: true, message: '请输入名称', trigger: 'blur' }
                ]
              }
            }
          ]
        }
      ],
      // 子表配置
      dTableConfig: [
        {
          key: "dietDictionary",
          name: "饮食词典项",
          columns: [
            {
              code: "code",
              name: "编码",
              span: 6,
              type: "text",
              config: {
                edit: false,
                rules: [
                  { required: true, message: '请输入编码', trigger: 'blur' }
                ]
              }
            },
            {
              code: "name",
              name: "名称",
              span: 6,
              type: "text",
              config: {
                edit: false
              }
            },
            {
              code: "dicDescribe",
              name: "词典描述",
              span: 6,
              type: "text",
              config: {
                edit: false
              }
            },
            {
              code: "ind",
              name: "序号",
              span: 6,
              type: "number",
              config: {
                edit: false,
                precision: 0,
                rules: [
                  { required: true, message: '请输入序号', trigger: 'blur' }
                ]
              }
            },
            {
              code: "pinyinCode",
              name: "拼音码",
              span: 6,
              type: "text",
              config: {
                edit: false
              }
            }
          ]
        }
      ]
    }
  }
}
</script>
